/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Interface for handling with Lua
 */

#ifndef LUAINTERFACE_H
#define LUAINTERFACE_H

#include "Common.h"

#include "cocos2d.h"
#include "CCScriptSupport.h"
#include "cocos2dx_support/CCLuaEngine.h"

class LuaInterface {
public:
	// default constructor
	LuaInterface();
	// default destructor
	~LuaInterface();

	// initialize engine
	void initEngine();

	// call init function of the script
	void callInitFunction();
	// call main update function of the script
	void callUpdateFunction( cocos2d::ccTime dt );

	// get lua engine
	cocos2d::CCScriptEngineProtocol *getEngine();
	// execute script
	void executeScript( const char *script );

private:
	// pointer to the lua engine
	cocos2d::CCScriptEngineProtocol *mLuaEngine;
};

#endif